//
//  CollectCollectionViewCell.m
//  HappinessTrip
//
//  Created by dllo on 15/10/19.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "CollectCollectionViewCell.h"
#import "Fit.h"

@implementation CollectCollectionViewCell
-(void)dealloc
{
    [_backImageView release];
    [_pictureImageView release];
    [_userImageView release];
    [_titleLabel release];
    [_timeLabel release];
    [_typeLabel release];
    [_moneyLabel release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createViews];
    }
    return self;
}
-(void)createViews
{
    _backImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:_backImageView];
    [_backImageView release];
    _pictureImageView = [[UIImageView alloc]init];
    [_backImageView addSubview:_pictureImageView];
    [_pictureImageView release];
    _userImageView = [[UIImageView alloc]init];
    [_backImageView addSubview:_userImageView];
    [_userImageView release];
    _titleLabel = [[UILabel alloc]init];
    [_backImageView addSubview:_titleLabel];
    [_titleLabel release];
    _timeLabel = [[UILabel alloc]init];
    [_backImageView addSubview:_timeLabel];
    [_timeLabel release];
    _typeLabel = [[UILabel alloc]init];
    [_backImageView addSubview:_typeLabel];
    [_typeLabel release];
    _moneyLabel = [[UILabel alloc]init];
    [_backImageView addSubview:_moneyLabel];
    [_moneyLabel release];
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _backImageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    _backImageView.layer.masksToBounds = YES;
    _backImageView.layer.cornerRadius = 5;
    _backImageView.backgroundColor = [UIColor colorWithRed:0.56 green:0.53 blue:0.93 alpha:1];
    _pictureImageView.frame = CGRectMake(0, 0, _backImageView.frame.size.width, 100 * H);
    _userImageView.frame = CGRectMake(110 * W, 85 * H, 30 * W, 30 * W);
    _userImageView.layer.cornerRadius = _userImageView.frame.size.width / 2;
    _userImageView.layer.masksToBounds = YES;
    _userImageView.layer.borderWidth = 2.0;
    _userImageView.layer.borderColor = [[UIColor whiteColor]CGColor];
    _titleLabel.frame = CGRectMake(_pictureImageView.frame.origin.x + 10 * W, _pictureImageView.frame.origin.y + _pictureImageView.frame.size.height + 10 * H, 80 * W, 20 * H);
    _titleLabel.font = [UIFont systemFontOfSize:13];
    _timeLabel.font = [UIFont systemFontOfSize:11];
    _timeLabel.frame = CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 5 * H, _backImageView.frame.size.width - 20 * W, 20 * H);
    _timeLabel.font = [UIFont systemFontOfSize:11];
    _typeLabel.frame = CGRectMake(_timeLabel.frame.origin.x, _timeLabel.frame.origin.y + _timeLabel.frame.size.height + 5 * H, 80 * W, 20 * H);
    _typeLabel.font = [UIFont systemFontOfSize:11];
    _moneyLabel.frame = CGRectMake(_userImageView.frame.origin.x, _typeLabel.frame.origin.y + 5 * H, 50 * W, 30 * H);
    _moneyLabel.font = [UIFont systemFontOfSize:13];
    _moneyLabel.textColor = [UIColor redColor];
    
    _titleLabel.textColor = [UIColor whiteColor];
    _timeLabel.textColor = [UIColor whiteColor];
    _typeLabel.textColor = [UIColor whiteColor];
    
}














@end
